package com.anxin.act.task.web;

import java.util.List;

import com.anxin.act.task.entity.WfActHiComment;
import com.anxin.act.task.service.WfActHiCommentService;
import com.anxin.framework.web.page.TableDataInfo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.anxin.framework.aspectj.lang.annotation.Log;
import com.anxin.framework.aspectj.lang.enums.BusinessType;
import com.anxin.framework.web.controller.BaseController;
import com.anxin.framework.web.entity.AjaxResult;

/**
 * 加签任务审批记录Controller
 *
 * @author jbs
 * @date 2021-10-22
 */
//@Api(tags = "加签任务审批记录" )
@RestController
@RequestMapping("/comment/wfActHiComment")
public class WfActHiCommentController extends BaseController{
    @Autowired
    private WfActHiCommentService wfActHiCommentService;

    /**
     * 查询加签任务审批记录列表
     */
    //@ApiOperation(value="查询加签任务审批记录列表" ,notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('system:comment:view')")
    @GetMapping("/list")
    @Log(title = "查询加签任务审批记录列表", businessType = BusinessType.LIST)
    public TableDataInfo<List<WfActHiComment>> list(WfActHiComment wfActHiComment){
        startPage();
        List<WfActHiComment> list = wfActHiCommentService.findList(wfActHiComment);
        return getDataTable(list);
    }


    /**
     * 获取加签任务审批记录详细信息
     */
    //@ApiOperation(value="获取加签任务审批记录详细信息",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('system:comment:view')")
    @GetMapping(value = "/{id}")
    @Log(title = "获取加签任务审批记录详细信息", businessType = BusinessType.LIST)
    public AjaxResult<WfActHiComment> getInfo(@PathVariable("id") String id){
        return AjaxResult.success(wfActHiCommentService.getById(id));
    }

    /**
     * 保存加签任务审批记录
     */
    //@ApiOperation(value="保存加签任务审批记录",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('system:comment:edit')")
    @Log(title = "加签任务审批记录", businessType = BusinessType.INSERT)
    @PostMapping("/save")
    public AjaxResult save(@RequestBody WfActHiComment wfActHiComment){
        wfActHiCommentService.save(wfActHiComment);
        return AjaxResult.success(wfActHiComment);
    }


    /**
     * 删除加签任务审批记录
     */
    //@ApiOperation(value="删除加签任务审批记录",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('system:comment:remove')")
    @Log(title = "加签任务审批记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{id}")
    public AjaxResult delete(@PathVariable(("id")) String id){
        return toAjax(wfActHiCommentService.deleteById(id));
    }
}
